package com.example.rocket.core;

import com.aliyun.openservices.ons.api.Message;
import lombok.Data;
import org.apache.rocketmq.common.message.MessageExt;

/**
 * @description: 牛逼 全量消息
 * @author TAO
 * @date 2021/12/22 5:45 下午
 */

@Data
public class NbMsg {

    private String msgId;

    private String tag;

    private String topic;

    private byte[] body;

    public NbMsg(Message onsMsg){
        this.msgId = onsMsg.getMsgID();
        this.tag = onsMsg.getTag();
        this.topic = onsMsg.getTopic();
        this.body = onsMsg.getBody();
    }

    public NbMsg(MessageExt rocketMessage){
        this.msgId = rocketMessage.getMsgId();
        this.tag = rocketMessage.getTopic();
        this.topic = rocketMessage.getTopic();
        this.body = rocketMessage.getBody();
    }







}
